sinc_filter Function

public pure function sinc_filter(fc, fs, x, fc2, ftype) result(rst)

Applies a sinc-in-time filter (rectangular frequency response).

Arguments

Type IntentOptional Attributes Name
real(kind=real64), intent(in) :: fc

The filter cutoff frequency, in Hz.

real(kind=real64), intent(in) :: fs

The sampling frequency, in Hz.

real(kind=real64), intent(in), dimension(:) :: x

The signal to filter.

real(kind=real64), intent(in), optional :: fc2

The second cutoff frequency for band-pass and band-stop filters.

integer(kind=int32), intent(in), optional :: ftype

The filter type. This parameter must be one of the following values:

  • LOW_PASS_FILTER: Denotes a low-pass filter.

  • HIGH_PASS_FILTER: Denotes a high-pass filter.

  • BAND_PASS_FILTER: Denotes a band-pass filter.

  • BAND_STOP_FILTER: Denotes a band-stop filter.

The default value is LOW_PASS_FILTER.

Return Value real(kind=real64), allocatable, dimension(:)

The filtered signal.